pp108 : Publishing Alerts

Publishing Alerts

This topic describes the process of publishing alerts.

Alerts are published by defining them on managed components and invoking the issueAlerts ( ) Web service operation on it. Here' s a sample code for issuing an alert.

try { } catch(LDAPException ldapEx) { // raise the alert defined earlier s_monitorStartLdapFailureAlert.issueAlert(ldapEx); } 


Additional parameters can also be passed if the alert messages in the XML file have parameter place holders in the form of {0}, {1} and so on.

This can be done using another form of issueAlert() API such as alertDefinition.issueAlert(exception, object array);

Once the alert is issued, it gets published to the consumers configured in theLog4jConfiguration.xml. For example, if the consumer configured is a file appender such as aProcessNamedDailyRollingFileAppender, then all the alerts will be published to appropriate files in <Process_Platform_Installation_Directory>\logs directory.
A sample alert message published would be:

<log4j:event logger='com.eibus.management.AlertSystem' timestamp='1138694792285' level='ERROR' thread='main'> <log4j:message><![CDATA[<LocalizableMessage resourceID='Cordys.Integrator.Messages.monitorStartErrorLdapFailure> The OpenText Process Suite Platform (&lt;instance name&gt;) could not be started due to failure to access the LDAP Server. Please ensure that the LDAP server is running. If so, the machine could be slow. Add the 'bus.ldaprequest.timeout=<timeout>' property in the wcp.properties file and specify the duration for request time out.</LocalizableMessage>]]></log4j:message> <log4j:NDC><![CDATA[host=CIN0389 processid=3172 messageid=__Unknown__ user=__Unknown__ component=__Unknown__]]></log4j:NDC> <log4j:throwable><![CDATA[LDAPException: Connect Error (91) Connect Error LDAPException: Server Message: Connect Error LDAPException: Unable to connect to server cin0389:6,366 (91) Connect Error java.net.ConnectException: Connection refused: connect at com.eibus.applicationconnector.ldap.LDAPWrapper.<init>(LDAPWrapper.java:72) at com.eibus.applicationconnector.monitor.Launcher.isLDAPServerReady(Launcher.java:370) at com.eibus.applicationconnector.monitor.MonitorService.isLDAPServerReady(MonitorService.java:21) Caused by: LDAPException: Unable to connect to server cin0389:6,366 (91) Connect Error]]></log4j:throwable> <log4j:locationInfo class='com.eibus.management.AlertSystem' method='issueAlert' file='AlertSystem.java' line='23'/> </log4j:event>

Related tasks

Generating Alerts
Generating Log Messages from Repository

Related reference

Message Repository
Defining Process Platform Alerts